<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- |</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- This module defines a simple JSON-based format for exporting basic</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- information about a Cabal package and the compiler configuration Cabal</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- would use to build it. This can be produced with the</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- @cabal new-show-build-info@ command.</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- This format is intended for consumption by external tooling and should</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- therefore be rather stable. Moreover, this allows tooling users to avoid</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- linking against Cabal. This is an important advantage as direct API usage</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- tends to be rather fragile in the presence of user-initiated upgrades of</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Cabal.</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Below is an example of the output this module produces,</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- { &quot;cabal-version&quot;: &quot;1.23.0.0&quot;,</span><span>
</span><span id="line-18"></span><span class="hs-comment">--   &quot;compiler&quot;: {</span><span>
</span><span id="line-19"></span><span class="hs-comment">--     &quot;flavour&quot;: &quot;GHC&quot;,</span><span>
</span><span id="line-20"></span><span class="hs-comment">--     &quot;compiler-id&quot;: &quot;ghc-7.10.2&quot;,</span><span>
</span><span id="line-21"></span><span class="hs-comment">--     &quot;path&quot;: &quot;/usr/bin/ghc&quot;,</span><span>
</span><span id="line-22"></span><span class="hs-comment">--   },</span><span>
</span><span id="line-23"></span><span class="hs-comment">--   &quot;components&quot;: [</span><span>
</span><span id="line-24"></span><span class="hs-comment">--     { &quot;type&quot;: &quot;lib&quot;,</span><span>
</span><span id="line-25"></span><span class="hs-comment">--       &quot;name&quot;: &quot;lib:Cabal&quot;,</span><span>
</span><span id="line-26"></span><span class="hs-comment">--       &quot;compiler-args&quot;:</span><span>
</span><span id="line-27"></span><span class="hs-comment">--         [&quot;-O&quot;, &quot;-XHaskell98&quot;, &quot;-Wall&quot;,</span><span>
</span><span id="line-28"></span><span class="hs-comment">--          &quot;-package-id&quot;, &quot;parallel-3.2.0.6-b79c38c5c25fff77f3ea7271851879eb&quot;]</span><span>
</span><span id="line-29"></span><span class="hs-comment">--       &quot;modules&quot;: [&quot;Project.ModA&quot;, &quot;Project.ModB&quot;, &quot;Paths_project&quot;],</span><span>
</span><span id="line-30"></span><span class="hs-comment">--       &quot;src-files&quot;: [],</span><span>
</span><span id="line-31"></span><span class="hs-comment">--       &quot;src-dirs&quot;: [&quot;src&quot;]</span><span>
</span><span id="line-32"></span><span class="hs-comment">--     }</span><span>
</span><span id="line-33"></span><span class="hs-comment">--   ]</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- }</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-36"></span><span class="hs-comment">--</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- The @cabal-version@ property provides the version of the Cabal library</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- which generated the output. The @compiler@ property gives some basic</span><span>
</span><span id="line-39"></span><span class="hs-comment">-- information about the compiler Cabal would use to compile the package.</span><span>
</span><span id="line-40"></span><span class="hs-comment">--</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- The @components@ property gives a list of the Cabal 'Component's defined by</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- the package. Each has,</span><span>
</span><span id="line-43"></span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- * @type@: the type of the component (one of @lib@, @exe@,</span><span>
</span><span id="line-45"></span><span class="hs-comment">--   @test@, @bench@, or @flib@)</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- * @name@: a string serving to uniquely identify the component within the</span><span>
</span><span id="line-47"></span><span class="hs-comment">--   package.</span><span>
</span><span id="line-48"></span><span class="hs-comment">-- * @compiler-args@: the command-line arguments Cabal would pass to the</span><span>
</span><span id="line-49"></span><span class="hs-comment">--   compiler to compile the component</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- * @modules@: the modules belonging to the component</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- * @src-dirs@: a list of directories where the modules might be found</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- * @src-files@: any other Haskell sources needed by the component</span><span>
</span><span id="line-53"></span><span class="hs-comment">--</span><span>
</span><span id="line-54"></span><span class="hs-comment">-- Note: At the moment this is only supported when using the GHC compiler.</span><span>
</span><span id="line-55"></span><span class="hs-comment">--</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.ShowBuildInfo</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.ShowBuildInfo.html#mkBuildInfo"><span class="hs-identifier">mkBuildInfo</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Simple.GHC.html"><span class="hs-identifier">Distribution.Simple.GHC</span></a></span><span>   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.GHC.html"><span class="hs-identifier">Distribution.Simple.Program.GHC</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">GHC</span></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.PackageDescription.html"><span class="hs-identifier">Distribution.PackageDescription</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compiler.html"><span class="hs-identifier">Distribution.Compiler</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Compiler.html"><span class="hs-identifier">Distribution.Simple.Compiler</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.LocalBuildInfo.html"><span class="hs-identifier">Distribution.Simple.LocalBuildInfo</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.html"><span class="hs-identifier">Distribution.Simple.Program</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html"><span class="hs-identifier">Distribution.Simple.Setup</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Utils.html#cabalVersion"><span class="hs-identifier">cabalVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.Json.html"><span class="hs-identifier">Distribution.Simple.Utils.Json</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.TargetInfo.html"><span class="hs-identifier">Distribution.Types.TargetInfo</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Text.html"><span class="hs-identifier">Distribution.Text</span></a></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">-- | Construct a JSON document describing the build information for a</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- package.</span><span>
</span><span id="line-80"></span><span class="annot"><a href="Distribution.Simple.ShowBuildInfo.html#mkBuildInfo"><span class="hs-identifier hs-type">mkBuildInfo</span></a></span><span>
</span><span id="line-81"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.PackageDescription.html#PackageDescription"><span class="hs-identifier hs-type">PackageDescription</span></a></span><span>  </span><span class="hs-comment">-- ^ Mostly information from the .cabal file</span><span>
</span><span id="line-82"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier hs-type">LocalBuildInfo</span></a></span><span>      </span><span class="hs-comment">-- ^ Configuration information</span><span>
</span><span id="line-83"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html#BuildFlags"><span class="hs-identifier hs-type">BuildFlags</span></a></span><span>          </span><span class="hs-comment">-- ^ Flags that the user passed to build</span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.TargetInfo.html#TargetInfo"><span class="hs-identifier hs-type">TargetInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.Json.html#Json"><span class="hs-identifier hs-type">Json</span></a></span><span>
</span><span id="line-86"></span><span id="mkBuildInfo"><span class="annot"><span class="annottext">mkBuildInfo :: PackageDescription
-&gt; LocalBuildInfo -&gt; BuildFlags -&gt; [TargetInfo] -&gt; Json
</span><a href="Distribution.Simple.ShowBuildInfo.html#mkBuildInfo"><span class="hs-identifier hs-var hs-var">mkBuildInfo</span></a></span></span><span> </span><span id="local-6989586621679720975"><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679720975"><span class="hs-identifier hs-var">pkg_descr</span></a></span></span><span> </span><span id="local-6989586621679720974"><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span></span><span> </span><span id="local-6989586621679720973"><span class="annot"><span class="annottext">BuildFlags
</span><a href="#local-6989586621679720973"><span class="hs-identifier hs-var">_flags</span></a></span></span><span> </span><span id="local-6989586621679720972"><span class="annot"><span class="annottext">[TargetInfo]
</span><a href="#local-6989586621679720972"><span class="hs-identifier hs-var">targetsToBuild</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Json
</span><a href="#local-6989586621679720971"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-88"></span><span>    </span><span id="local-6989586621679720970"><span class="annot"><span class="annottext">targetToNameAndLBI :: TargetInfo -&gt; (ComponentName, ComponentLocalBuildInfo)
</span><a href="#local-6989586621679720970"><span class="hs-identifier hs-var hs-var">targetToNameAndLBI</span></a></span></span><span> </span><span id="local-6989586621679720969"><span class="annot"><span class="annottext">TargetInfo
</span><a href="#local-6989586621679720969"><span class="hs-identifier hs-var">target</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-89"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentLocalBuildInfo -&gt; ComponentName
</span><a href="Distribution.Types.ComponentLocalBuildInfo.html#componentLocalName"><span class="hs-identifier hs-var hs-var">componentLocalName</span></a></span><span> </span><span class="annot"><span class="annottext">(ComponentLocalBuildInfo -&gt; ComponentName)
-&gt; ComponentLocalBuildInfo -&gt; ComponentName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TargetInfo -&gt; ComponentLocalBuildInfo
</span><a href="Distribution.Types.TargetInfo.html#targetCLBI"><span class="hs-identifier hs-var hs-var">targetCLBI</span></a></span><span> </span><span class="annot"><span class="annottext">TargetInfo
</span><a href="#local-6989586621679720969"><span class="hs-identifier hs-var">target</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TargetInfo -&gt; ComponentLocalBuildInfo
</span><a href="Distribution.Types.TargetInfo.html#targetCLBI"><span class="hs-identifier hs-var hs-var">targetCLBI</span></a></span><span> </span><span class="annot"><span class="annottext">TargetInfo
</span><a href="#local-6989586621679720969"><span class="hs-identifier hs-var">target</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>    </span><span id="local-6989586621679720966"><span class="annot"><span class="annottext">componentsToBuild :: [(ComponentName, ComponentLocalBuildInfo)]
</span><a href="#local-6989586621679720966"><span class="hs-identifier hs-var hs-var">componentsToBuild</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TargetInfo -&gt; (ComponentName, ComponentLocalBuildInfo))
-&gt; [TargetInfo] -&gt; [(ComponentName, ComponentLocalBuildInfo)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TargetInfo -&gt; (ComponentName, ComponentLocalBuildInfo)
</span><a href="#local-6989586621679720970"><span class="hs-identifier hs-var">targetToNameAndLBI</span></a></span><span> </span><span class="annot"><span class="annottext">[TargetInfo]
</span><a href="#local-6989586621679720972"><span class="hs-identifier hs-var">targetsToBuild</span></a></span><span>
</span><span id="line-91"></span><span>    </span><span class="annot"><a href="#local-6989586621679720965"><span class="hs-operator hs-type">(.=)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.Json.html#Json"><span class="hs-identifier hs-type">Json</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.Json.html#Json"><span class="hs-identifier hs-type">Json</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>    </span><span id="local-6989586621679720964"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679720964"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679720965"><span class="annot"><span class="annottext">.= :: String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var hs-var">.=</span></a></span></span><span> </span><span id="local-6989586621679720963"><span class="annot"><span class="annottext">Json
</span><a href="#local-6989586621679720963"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679720964"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Json
</span><a href="#local-6989586621679720963"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span>    </span><span id="local-6989586621679720971"><span class="annot"><span class="annottext">info :: Json
</span><a href="#local-6989586621679720971"><span class="hs-identifier hs-var hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, Json)] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonObject"><span class="hs-identifier hs-var">JsonObject</span></a></span><span>
</span><span id="line-95"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cabal-version&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Version -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Text.html#display"><span class="hs-identifier hs-var">display</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="Distribution.Simple.Utils.html#cabalVersion"><span class="hs-identifier hs-var">cabalVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compiler&quot;</span></span><span>      </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">Json
</span><a href="#local-6989586621679720957"><span class="hs-identifier hs-var">mkCompilerInfo</span></a></span><span>
</span><span id="line-97"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;components&quot;</span></span><span>    </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">[Json] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonArray"><span class="hs-identifier hs-var">JsonArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((ComponentName, ComponentLocalBuildInfo) -&gt; Json)
-&gt; [(ComponentName, ComponentLocalBuildInfo)] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(ComponentName, ComponentLocalBuildInfo) -&gt; Json
</span><a href="#local-6989586621679720955"><span class="hs-identifier hs-var">mkComponentInfo</span></a></span><span> </span><span class="annot"><span class="annottext">[(ComponentName, ComponentLocalBuildInfo)]
</span><a href="#local-6989586621679720966"><span class="hs-identifier hs-var">componentsToBuild</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span>    </span><span id="local-6989586621679720957"><span class="annot"><span class="annottext">mkCompilerInfo :: Json
</span><a href="#local-6989586621679720957"><span class="hs-identifier hs-var hs-var">mkCompilerInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, Json)] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonObject"><span class="hs-identifier hs-var">JsonObject</span></a></span><span>
</span><span id="line-101"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;flavour&quot;</span></span><span>     </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CompilerFlavor -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">(CompilerFlavor -&gt; String) -&gt; CompilerFlavor -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Compiler -&gt; CompilerFlavor
</span><a href="Distribution.Simple.Compiler.html#compilerFlavor"><span class="hs-identifier hs-var">compilerFlavor</span></a></span><span> </span><span class="annot"><span class="annottext">(Compiler -&gt; CompilerFlavor) -&gt; Compiler -&gt; CompilerFlavor
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compiler-id&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Compiler -&gt; String
</span><a href="Distribution.Simple.Compiler.html#showCompilerId"><span class="hs-identifier hs-var">showCompilerId</span></a></span><span> </span><span class="annot"><span class="annottext">(Compiler -&gt; String) -&gt; Compiler -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;path&quot;</span></span><span>        </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">Json
</span><a href="#local-6989586621679720948"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-104"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-105"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-106"></span><span>        </span><span id="local-6989586621679720948"><span class="annot"><span class="annottext">path :: Json
</span><a href="#local-6989586621679720948"><span class="hs-identifier hs-var hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Json
-&gt; (ConfiguredProgram -&gt; Json) -&gt; Maybe ConfiguredProgram -&gt; Json
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonNull"><span class="hs-identifier hs-var">JsonNull</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Json)
-&gt; (ConfiguredProgram -&gt; String) -&gt; ConfiguredProgram -&gt; Json
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; String
</span><a href="Distribution.Simple.Program.Types.html#programPath"><span class="hs-identifier hs-var">programPath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>               </span><span class="annot"><span class="annottext">(Maybe ConfiguredProgram -&gt; Json)
-&gt; Maybe ConfiguredProgram -&gt; Json
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CompilerFlavor -&gt; Maybe Program
</span><a href="#local-6989586621679720941"><span class="hs-identifier hs-var">flavorToProgram</span></a></span><span> </span><span class="annot"><span class="annottext">(CompilerFlavor -&gt; Maybe Program)
-&gt; (Compiler -&gt; CompilerFlavor) -&gt; Compiler -&gt; Maybe Program
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Compiler -&gt; CompilerFlavor
</span><a href="Distribution.Simple.Compiler.html#compilerFlavor"><span class="hs-identifier hs-var">compilerFlavor</span></a></span><span> </span><span class="annot"><span class="annottext">(Compiler -&gt; Maybe Program) -&gt; Compiler -&gt; Maybe Program
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span>               </span><span class="annot"><span class="annottext">Maybe Program
-&gt; (Program -&gt; Maybe ConfiguredProgram) -&gt; Maybe ConfiguredProgram
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">(Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram)
-&gt; ProgramDb -&gt; Program -&gt; Maybe ConfiguredProgram
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Program -&gt; ProgramDb -&gt; Maybe ConfiguredProgram
</span><a href="Distribution.Simple.Program.Db.html#lookupProgram"><span class="hs-identifier hs-var">lookupProgram</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; ProgramDb
</span><a href="Distribution.Types.LocalBuildInfo.html#withPrograms"><span class="hs-identifier hs-var hs-var">withPrograms</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>        </span><span class="annot"><a href="#local-6989586621679720941"><span class="hs-identifier hs-type">flavorToProgram</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Compiler.html#CompilerFlavor"><span class="hs-identifier hs-type">CompilerFlavor</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Types.html#Program"><span class="hs-identifier hs-type">Program</span></a></span><span>
</span><span id="line-111"></span><span>        </span><span id="local-6989586621679720941"><span class="annot"><span class="annottext">flavorToProgram :: CompilerFlavor -&gt; Maybe Program
</span><a href="#local-6989586621679720941"><span class="hs-identifier hs-var hs-var">flavorToProgram</span></a></span></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#GHC"><span class="hs-identifier hs-var">GHC</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Maybe Program
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="Distribution.Simple.Program.Builtin.html#ghcProgram"><span class="hs-identifier hs-var">ghcProgram</span></a></span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><a href="#local-6989586621679720941"><span class="hs-identifier hs-var">flavorToProgram</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#GHCJS"><span class="hs-identifier hs-var">GHCJS</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Maybe Program
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="Distribution.Simple.Program.Builtin.html#ghcjsProgram"><span class="hs-identifier hs-var">ghcjsProgram</span></a></span><span>
</span><span id="line-113"></span><span>        </span><span class="annot"><a href="#local-6989586621679720941"><span class="hs-identifier hs-var">flavorToProgram</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#UHC"><span class="hs-identifier hs-var">UHC</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Maybe Program
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="Distribution.Simple.Program.Builtin.html#uhcProgram"><span class="hs-identifier hs-var">uhcProgram</span></a></span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><a href="#local-6989586621679720941"><span class="hs-identifier hs-var">flavorToProgram</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#JHC"><span class="hs-identifier hs-var">JHC</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Program -&gt; Maybe Program
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="Distribution.Simple.Program.Builtin.html#jhcProgram"><span class="hs-identifier hs-var">jhcProgram</span></a></span><span>
</span><span id="line-115"></span><span>        </span><span class="annot"><a href="#local-6989586621679720941"><span class="hs-identifier hs-var">flavorToProgram</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Program
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679720955"><span class="annot"><span class="annottext">mkComponentInfo :: (ComponentName, ComponentLocalBuildInfo) -&gt; Json
</span><a href="#local-6989586621679720955"><span class="hs-identifier hs-var hs-var">mkComponentInfo</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679720923"><span class="annot"><span class="annottext">ComponentName
</span><a href="#local-6989586621679720923"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679720922"><span class="annot"><span class="annottext">ComponentLocalBuildInfo
</span><a href="#local-6989586621679720922"><span class="hs-identifier hs-var">clbi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, Json)] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonObject"><span class="hs-identifier hs-var">JsonObject</span></a></span><span>
</span><span id="line-118"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type&quot;</span></span><span>          </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679720921"><span class="hs-identifier hs-var">compType</span></a></span><span>
</span><span id="line-119"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;name&quot;</span></span><span>          </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentName
</span><a href="#local-6989586621679720923"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unit-id&quot;</span></span><span>       </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">(UnitId -&gt; String) -&gt; UnitId -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentLocalBuildInfo -&gt; UnitId
</span><a href="Distribution.Types.ComponentLocalBuildInfo.html#componentUnitId"><span class="hs-identifier hs-var hs-var">componentUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentLocalBuildInfo
</span><a href="#local-6989586621679720922"><span class="hs-identifier hs-var">clbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;compiler-args&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">[Json] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonArray"><span class="hs-identifier hs-var">JsonArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Json) -&gt; [String] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [Json]) -&gt; [String] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; LocalBuildInfo -&gt; ComponentLocalBuildInfo -&gt; [String]
</span><a href="Distribution.Simple.ShowBuildInfo.html#getCompilerArgs"><span class="hs-identifier hs-var">getCompilerArgs</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679720918"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720974"><span class="hs-identifier hs-var">lbi</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentLocalBuildInfo
</span><a href="#local-6989586621679720922"><span class="hs-identifier hs-var">clbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;modules&quot;</span></span><span>       </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">[Json] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonArray"><span class="hs-identifier hs-var">JsonArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ModuleName -&gt; Json) -&gt; [ModuleName] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Json) -&gt; (ModuleName -&gt; String) -&gt; ModuleName -&gt; Json
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Text.html#display"><span class="hs-identifier hs-var">display</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621679720917"><span class="hs-identifier hs-var">modules</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;src-files&quot;</span></span><span>     </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">[Json] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonArray"><span class="hs-identifier hs-var">JsonArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Json) -&gt; [String] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679720916"><span class="hs-identifier hs-var">sourceFiles</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;src-dirs&quot;</span></span><span>      </span><span class="annot"><span class="annottext">String -&gt; Json -&gt; (String, Json)
</span><a href="#local-6989586621679720965"><span class="hs-operator hs-var">.=</span></a></span><span> </span><span class="annot"><span class="annottext">[Json] -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonArray"><span class="hs-identifier hs-var">JsonArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Json) -&gt; [String] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Json
</span><a href="Distribution.Simple.Utils.Json.html#JsonString"><span class="hs-identifier hs-var">JsonString</span></a></span><span> </span><span class="annot"><span class="annottext">([String] -&gt; [Json]) -&gt; [String] -&gt; [Json]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo -&gt; [String]
</span><a href="Distribution.Types.BuildInfo.html#hsSourceDirs"><span class="hs-identifier hs-var hs-var">hsSourceDirs</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679720918"><span class="hs-identifier hs-var">bi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-126"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-127"></span><span>        </span><span id="local-6989586621679720918"><span class="annot"><span class="annottext">bi :: BuildInfo
</span><a href="#local-6989586621679720918"><span class="hs-identifier hs-var hs-var">bi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Component -&gt; BuildInfo
</span><a href="Distribution.Types.Component.html#componentBuildInfo"><span class="hs-identifier hs-var">componentBuildInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Component
</span><a href="#local-6989586621679720913"><span class="hs-identifier hs-var">comp</span></a></span><span>
</span><span id="line-128"></span><span>        </span><span id="local-6989586621679720913"><span class="annot"><span class="annottext">comp :: Component
</span><a href="#local-6989586621679720913"><span class="hs-identifier hs-var hs-var">comp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Component -&gt; Maybe Component -&gt; Component
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Component
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Component) -&gt; String -&gt; Component
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkBuildInfo: no component &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentName -&gt; String
forall a. Pretty a =&gt; a -&gt; String
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentName
</span><a href="#local-6989586621679720923"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe Component -&gt; Component) -&gt; Maybe Component -&gt; Component
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription -&gt; ComponentName -&gt; Maybe Component
</span><a href="Distribution.Types.PackageDescription.html#lookupComponent"><span class="hs-identifier hs-var">lookupComponent</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDescription
</span><a href="#local-6989586621679720975"><span class="hs-identifier hs-var">pkg_descr</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentName
</span><a href="#local-6989586621679720923"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-129"></span><span>        </span><span id="local-6989586621679720921"><span class="annot"><span class="annottext">compType :: String
</span><a href="#local-6989586621679720921"><span class="hs-identifier hs-var hs-var">compType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Component
</span><a href="#local-6989586621679720913"><span class="hs-identifier hs-var">comp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-130"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CLib"><span class="hs-identifier hs-type">CLib</span></a></span><span> </span><span class="annot"><span class="annottext">Library
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lib&quot;</span></span><span>
</span><span id="line-131"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CExe"><span class="hs-identifier hs-type">CExe</span></a></span><span> </span><span class="annot"><span class="annottext">Executable
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exe&quot;</span></span><span>
</span><span id="line-132"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CTest"><span class="hs-identifier hs-type">CTest</span></a></span><span> </span><span class="annot"><span class="annottext">TestSuite
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;test&quot;</span></span><span>
</span><span id="line-133"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CBench"><span class="hs-identifier hs-type">CBench</span></a></span><span> </span><span class="annot"><span class="annottext">Benchmark
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bench&quot;</span></span><span>
</span><span id="line-134"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CFLib"><span class="hs-identifier hs-type">CFLib</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignLib
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;flib&quot;</span></span><span>
</span><span id="line-135"></span><span>        </span><span id="local-6989586621679720917"><span class="annot"><span class="annottext">modules :: [ModuleName]
</span><a href="#local-6989586621679720917"><span class="hs-identifier hs-var hs-var">modules</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Component
</span><a href="#local-6989586621679720913"><span class="hs-identifier hs-var">comp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-136"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CLib"><span class="hs-identifier hs-type">CLib</span></a></span><span> </span><span id="local-6989586621679720901"><span class="annot"><span class="annottext">Library
</span><a href="#local-6989586621679720901"><span class="hs-identifier hs-var">lib</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Library -&gt; [ModuleName]
</span><a href="Distribution.Types.Library.html#explicitLibModules"><span class="hs-identifier hs-var">explicitLibModules</span></a></span><span> </span><span class="annot"><span class="annottext">Library
</span><a href="#local-6989586621679720901"><span class="hs-identifier hs-var">lib</span></a></span><span>
</span><span id="line-137"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CExe"><span class="hs-identifier hs-type">CExe</span></a></span><span> </span><span id="local-6989586621679720899"><span class="annot"><span class="annottext">Executable
</span><a href="#local-6989586621679720899"><span class="hs-identifier hs-var">exe</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Executable -&gt; [ModuleName]
</span><a href="Distribution.Types.Executable.html#exeModules"><span class="hs-identifier hs-var">exeModules</span></a></span><span> </span><span class="annot"><span class="annottext">Executable
</span><a href="#local-6989586621679720899"><span class="hs-identifier hs-var">exe</span></a></span><span>
</span><span id="line-138"></span><span>          </span><span class="annot"><span class="annottext">Component
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-139"></span><span>        </span><span id="local-6989586621679720916"><span class="annot"><span class="annottext">sourceFiles :: [String]
</span><a href="#local-6989586621679720916"><span class="hs-identifier hs-var hs-var">sourceFiles</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Component
</span><a href="#local-6989586621679720913"><span class="hs-identifier hs-var">comp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-140"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CLib"><span class="hs-identifier hs-type">CLib</span></a></span><span> </span><span class="annot"><span class="annottext">Library
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-141"></span><span>          </span><span class="annot"><a href="Distribution.Types.Component.html#CExe"><span class="hs-identifier hs-type">CExe</span></a></span><span> </span><span id="local-6989586621679720897"><span class="annot"><span class="annottext">Executable
</span><a href="#local-6989586621679720897"><span class="hs-identifier hs-var">exe</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Executable -&gt; String
</span><a href="Distribution.Types.Executable.html#modulePath"><span class="hs-identifier hs-var hs-var">modulePath</span></a></span><span> </span><span class="annot"><span class="annottext">Executable
</span><a href="#local-6989586621679720897"><span class="hs-identifier hs-var">exe</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-142"></span><span>          </span><span class="annot"><span class="annottext">Component
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-comment">-- | Get the command-line arguments that would be passed</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- to the compiler to build the given component.</span><span>
</span><span id="line-146"></span><span class="annot"><a href="Distribution.Simple.ShowBuildInfo.html#getCompilerArgs"><span class="hs-identifier hs-type">getCompilerArgs</span></a></span><span>
</span><span id="line-147"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.BuildInfo.html#BuildInfo"><span class="hs-identifier hs-type">BuildInfo</span></a></span><span>
</span><span id="line-148"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier hs-type">LocalBuildInfo</span></a></span><span>
</span><span id="line-149"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentLocalBuildInfo.html#ComponentLocalBuildInfo"><span class="hs-identifier hs-type">ComponentLocalBuildInfo</span></a></span><span>
</span><span id="line-150"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-151"></span><span id="getCompilerArgs"><span class="annot"><span class="annottext">getCompilerArgs :: BuildInfo -&gt; LocalBuildInfo -&gt; ComponentLocalBuildInfo -&gt; [String]
</span><a href="Distribution.Simple.ShowBuildInfo.html#getCompilerArgs"><span class="hs-identifier hs-var hs-var">getCompilerArgs</span></a></span></span><span> </span><span id="local-6989586621679720895"><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679720895"><span class="hs-identifier hs-var">bi</span></a></span></span><span> </span><span id="local-6989586621679720894"><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span></span><span> </span><span id="local-6989586621679720893"><span class="annot"><span class="annottext">ComponentLocalBuildInfo
</span><a href="#local-6989586621679720893"><span class="hs-identifier hs-var">clbi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-152"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Compiler -&gt; CompilerFlavor
</span><a href="Distribution.Simple.Compiler.html#compilerFlavor"><span class="hs-identifier hs-var">compilerFlavor</span></a></span><span> </span><span class="annot"><span class="annottext">(Compiler -&gt; CompilerFlavor) -&gt; Compiler -&gt; CompilerFlavor
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-153"></span><span>      </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#GHC"><span class="hs-identifier hs-var">GHC</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679720892"><span class="hs-identifier hs-var">ghc</span></a></span><span>
</span><span id="line-154"></span><span>      </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="Distribution.Compiler.html#GHCJS"><span class="hs-identifier hs-var">GHCJS</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679720892"><span class="hs-identifier hs-var">ghc</span></a></span><span>
</span><span id="line-155"></span><span>      </span><span id="local-6989586621679720891"><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="#local-6989586621679720891"><span class="hs-identifier hs-var">c</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; [String]
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; [String]) -&gt; String -&gt; [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ShowBuildInfo.getCompilerArgs: Don't know how to get &quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-156"></span><span>                       </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;build arguments for compiler &quot;</span></span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span class="annot"><span class="annottext">CompilerFlavor -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerFlavor
</span><a href="#local-6989586621679720891"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-158"></span><span>    </span><span class="hs-comment">-- This is absolutely awful</span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621679720892"><span class="annot"><span class="annottext">ghc :: [String]
</span><a href="#local-6989586621679720892"><span class="hs-identifier hs-var hs-var">ghc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Compiler -&gt; Platform -&gt; GhcOptions -&gt; [String]
</span><a href="Distribution.Simple.Program.GHC.html#renderGhcOptions"><span class="hs-identifier hs-var">GHC.renderGhcOptions</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Platform
</span><a href="Distribution.Types.LocalBuildInfo.html#hostPlatform"><span class="hs-identifier hs-var hs-var">hostPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GhcOptions
</span><a href="#local-6989586621679720887"><span class="hs-identifier hs-var">baseOpts</span></a></span><span>
</span><span id="line-160"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-161"></span><span>        </span><span id="local-6989586621679720887"><span class="annot"><span class="annottext">baseOpts :: GhcOptions
</span><a href="#local-6989586621679720887"><span class="hs-identifier hs-var hs-var">baseOpts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; LocalBuildInfo
-&gt; BuildInfo
-&gt; ComponentLocalBuildInfo
-&gt; String
-&gt; GhcOptions
</span><a href="Distribution.Simple.GHC.html#componentGhcOptions"><span class="hs-identifier hs-var">GHC.componentGhcOptions</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#normal"><span class="hs-identifier hs-var">normal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span><span> </span><span class="annot"><span class="annottext">BuildInfo
</span><a href="#local-6989586621679720895"><span class="hs-identifier hs-var">bi</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentLocalBuildInfo
</span><a href="#local-6989586621679720893"><span class="hs-identifier hs-var">clbi</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; String
</span><a href="Distribution.Types.LocalBuildInfo.html#buildDir"><span class="hs-identifier hs-var hs-var">buildDir</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679720894"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-162"></span></pre></body></html>